package model

import (
	"time"
)

// Product 产品模型
type Product struct {
	ID          uint      `json:"id" gorm:"primaryKey"`
	Name        string    `json:"name" gorm:"not null"`
	Category    string    `json:"category" gorm:"not null"`
	Description string    `json:"description"`
	Image       string    `json:"image"`
	CreatedAt   time.Time `json:"created_at"`
}

// Application 应用领域模型
type Application struct {
	ID          uint      `json:"id" gorm:"primaryKey"`
	Category    string    `json:"category" gorm:"not null"`
	Name        string    `json:"name" gorm:"not null"`
	Description string    `json:"description"`
	Image       string    `json:"image"`
	Properties  string    `json:"properties"`
	CreatedAt   time.Time `json:"created_at"`
}

// News 新闻模型
type News struct {
	ID        uint      `json:"id" gorm:"primaryKey"`
	Title     string    `json:"title" gorm:"not null"`
	Content   string    `json:"content"`
	Image     string    `json:"image"`
	CreatedAt time.Time `json:"created_at"`
}

// Contact 客户咨询模型
type Contact struct {
	ID        uint      `json:"id" gorm:"primaryKey"`
	Name      string    `json:"name" gorm:"not null"`
	Email     string    `json:"email" gorm:"not null"`
	Phone     string    `json:"phone"`
	Product   string    `json:"product"`
	Message   string    `json:"message" gorm:"not null"`
	CreatedAt time.Time `json:"created_at"`
}

// Admin 管理员模型
type Admin struct {
	ID        uint      `json:"id" gorm:"primaryKey"`
	Username   string    `json:"username" gorm:"unique;not null"`
	Password   string    `json:"-" gorm:"not null"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

// DashboardStats 仪表板统计数据模型
type DashboardStats struct {
	ProductsCount     int64 `json:"products_count"`
	ApplicationsCount int64 `json:"applications_count"`
	ContactsCount    int64 `json:"contacts_count"`
	NewsCount        int64 `json:"news_count"`
}

// APIResponse 通用API响应模型
type APIResponse struct {
	Success bool        `json:"success"`
	Message string       `json:"message,omitempty"`
	Data    interface{}   `json:"data,omitempty"`
}

// PaginatedResponse 分页响应模型
type PaginatedResponse struct {
	Success bool        `json:"success"`
	Message string       `json:"message,omitempty"`
	Data    interface{}   `json:"data,omitempty"`
	Total   int64         `json:"total"`
	Page    int           `json:"page"`
	PerPage int           `json:"per_page"`
}